<!DOCTYPE html>
<html lang="">

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0">
  <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>

</head>

<body>
  <noscript>

  </noscript>
  <div id="app">
    <p>{{date}}</p>
  </div>
  <script>
    Vue.createApp({
      data() {
        return {
          date: '00:00:00'
        }
      },
      mounted() { //mounted()生命周期：DOM挂载后
        setInterval(() => {
          let d = new Date();
          this.date = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
        }, 1000);
      }
    }).mount('#app')
  </script>
  <!-- built files will be auto injected -->
</body>

</html>